using System.Windows.Media;
using _3DTicTacToe.Core;

namespace _3DTicTacToe
{
    partial class GameWindow
    {
        public static Color InvertColor(Color color)
        {
            return Color.FromArgb(color.A,
                    (byte)(255 - color.R),
                    (byte)(255 - color.G),
                    (byte)(255 - color.B));
        }

        void _game_OnTurn(Turn turn)
        {
            var player = _game.NextPlayer;

            playerBorder.Background = new SolidColorBrush(player.Color);
            playerControl.Foreground = new SolidColorBrush(InvertColor(player.Color));
            playerControl.Content = player.Name;
        }
    }
}